#delimit

use "CPS_reg_turnout.dta";

sort year;

gen v_r_0 = vote_reg_t[_n-2];
gen v_hat = v_r_0*reg_tot_pct*vap; 
gen turnout = vap*vote_tot_pct;

gen error = turnout-v_hat;
gen pct_error = (turnout-v_hat)/turnout;
sum turnout v_hat error pct_error;

